<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>查询学生的信息</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios.min.js"></script>

</head>
<body>
<div class="wrap" id="app">
    <button class="find" @click="findstudents">
        查询学生信息
    </button>

    <table width="500" border="1">
        <tr>
            <th>学生编号</th>
            <th>学生姓名</th>
            <th>学生年龄</th>
        </tr>

        <tr v-for="item in students">
            <td>{{item.sid}}</td>
            <td>{{item.name}}</td>
            <td>{{item.age}}</td>
        </tr>
    </table>
</div>
</body>

<script>
    let app = new Vue({
        el:"#app",
        data:{
            studentVo:{},
            students:[],
        },
        methods:{
            findstudents(){
                axios.get("http://localhost:8080/student/select").then(result=>{
                    console.log(result)
                    this.students= result.data.data;
                })
            }
        }
    })
</script>
</html>